package com.project.bean;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDate;

/**
 * @Author(王思翰)
 * @Description(类的描述)
 * @Date(创建时间) 2021/8/5 9:32
 */
public class kaoshiUserBean {
    private int id;
    @Pattern(regexp = "[a-zA-Z0-9_-]{2,16}",message = "用户名输入错误")
    private String name;

    @Pattern(regexp = ".*(?=.{6,})(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*",message = "密码错误")
    private String pwd;
    private String sex;

    @NotNull(message = "工资不能为空")
    @Max(value = 9999999,message ="不能大于9999999" )
    @Min(value = 0,message = "不能小于0")
    private Integer money;

    @NotNull(message = "生日不能为空")
    private LocalDate birthday;

    public kaoshiUserBean() {
    }

    public kaoshiUserBean(String name, String pwd, String sex, int money, LocalDate birthday) {
        this.name = name;
        this.pwd = pwd;
        this.sex = sex;
        this.money = money;
        this.birthday = birthday;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "kaoshiUserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", sex='" + sex + '\'' +
                ", money=" + money +
                ", birthday=" + birthday +
                '}';
    }
}
